<template>
	<view class="nav-bar-white">
		<view :style="{height:statusBarHeight+'px'}"></view>
		<uni-nav-bar left-icon="left" background-color="#FFF" color="#000" @clickLeft="back" title="添加规格值" :border="false" fixed="true"></uni-nav-bar>
	</view>
	<view class="body-content-padding" :style="{marginTop:statusBarHeight+45+'px'}">
		<view style="margin-left: 30rpx;padding-top: 20rpx;">
			<text>设置颜色</text>
		</view>
		<view class="item-sku">
			<view class="flex-col" v-for="(item,index) in skuList" :key="index">
				<view class="flex-row items-center" style="margin-bottom: 30rpx;margin-top: 30rpx;">
					<view class="flex-row justify-between items-center" style="width: 30%;">
						<image src="/static/goods/red_delete.png" style="width: 35rpx;height: 35rpx;"></image>
						<text>规格值{{index+1}}</text>
					</view>
					<view style="width: 70%;padding-left: 80rpx;">
						<text>黑色</text>
					</view>
					
				</view>
				<view class="line"></view>
			</view>
			
		</view>
		
		
		<view class="flex-row justify-center" style="margin-top: 50rpx;color: #3274F9;">
			<text @click="addSkuData">+ 添加规格值</text>
		</view>
	</view>
	
	
	
	
	
	<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0" background-color="#fff">
		<view class="flex-col pop-bg" style="padding: 25rpx;">
			<view class="flex-row justify-between">
				<text>添加规格值</text>
				<uni-icons type="closeempty" size="22" @click="closePop"></uni-icons>
			</view>
			<view class="line" style="margin-top: 30rpx;color: #fff;">.</view>
			<view style="margin-top: 30rpx;">
				<view class="flex-row items-center">
					<text>规格值</text>
					<text style="color: #D64444;">*</text>
				</view>
				<input style="margin-top: 30rpx;" v-model="sku_name" placeholder="请输入规格值" />
			</view>
			<view class="line" style="margin-top: 30rpx;color: #fff;">.</view>
			<button class="btn-sure">确定</button>
		</view>
	</uni-popup>
</template>

<script>
	import { useUserStore } from '../../store/userStore';
	export default {
		data() {
			return {
				skuList:[{},{}],
				sku_name:''
			};
		},
		computed:{
			statusBarHeight(){
				return useUserStore().statusBarHeight
			}
		},
		methods:{
			addSkuData(){
				this.$refs.popup.open()
			},
			closePop(){
				this.$refs.popup.close()
			},
			back(){
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
.item-sku{
	background-color: #fff;
	border-radius: 10rpx;
	margin: 15rpx;
	padding-left: 30rpx;
	padding-right: 30rpx;
	padding-top: 5rpx;
	padding-bottom: 5rpx;
	display: flex;
	flex-direction: column;
}
.pop-bg{
	max-height: 40vh;
	overflow-y: auto;
}
.btn-sure{
	height: 80rpx;
	margin-top: 100rpx;
	margin-left: 50rpx;
	margin-right: 50rpx;
	background-color: #3274F9;
	border-radius: 45rpx;
	color: #fff;
	display: flex;
	justify-content: center;
	align-items: center;
}
</style>
